<!DOCTYPE html>
<html>

	<head lang="en">
		<title>私人订制页面</title>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<link rel="stylesheet" href="/js/bootstrap/css/bootstrap.min.css">
		<script src="/js/jquery/jquery.min.js"></script>
		<script src="/js/bootstrap/js/bootstrap.min.js"></script>
		<link rel="stylesheet" href="/css/font/css/font-awesome.min.css" />
		<link rel="stylesheet" href="/css/reset.css" />
		<link rel="stylesheet" href="/css/news.css" />
		<link rel="stylesheet" href="/js/plugins/dialog/dialog.css" />
		<script src="/js/plugins/jrender/jrender.js"></script>
		<link rel="stylesheet" href="/js/plugins/jquery-confirm/css/jquery-confirm.css">
		<script src="/js/plugins/jquery-confirm/js/jquery-confirm.js"></script>
		<script src="/js/plugins/dialog/dialog.min.js"></script>
		<script src="/js/common.js"></script>
	
	</head>

	<body>
		

		<!--<div class="search-head">
			<div class="row nav-search">
				<div class="col-2">
					<a href="index.html">
						<span><i class="fa fa-chevron-left fa-2x"></i></span>
					</a>
				</div>
				<div class="col-10">
					<div class="input-group-sm search">
						<input class="form-control searchBtn" placeholder="搜索资讯">
					</div>
				</div>
			</div>
		</div>-->

		<div class="container news">
		
			<div class="news">
				<h6 class="news-title">私人订制页面 </h6>
				<div class="row" render-loop="list">
					<div class="col-6">
						<a href="personalContent.html" data-id="id" render-key="list.id" render-fun="handle">
							<img class="rounded" width="100%" height="110px"  render-src="list.coverUrl">
						</a>
						<div class="caption">
							<p>
								<span > </span>
								<i class="fa fa-heart-o collectionBtn">
								</i>
							</p>
							<a href="personalContent.html" render-key="list.id" render-fun="handle">
								<h5 render-html="list.title"></h5>
								<p render-html="list.subTitle"></p>
							</a>
						</div>
					</div>

				</div>
			</div>
		</div>
<script>

	var currentPage = 1;
	var pages;
	var news;
	$(function () {
        //查询日报信息
        $.get("/personals", function (data) {
            //渲染日报
            $(".news").renderValues(data, {
                handle: function (ele, value) {
                    ele.href = "/shore/personalContent.html?id="+value;
                }
            });
        });

        //发送ajax请求,获取日报
        $.get("/personals", {state:1}, function (data) {
            //数据渲染
            renderViews(data);
            pages = data.pages;
            news = data.list;
        });

        //设置窗口的滚到事件
        $(window).scroll(function () {
            if (isEnd()) {
                if (currentPage < pages) {
                    currentPage++;
                    var args = {state: 1,currentPage: currentPage};
                    $.get("/personals", args, function (data) {
                        //数据渲染
                        $.merge(news, data.list);
                        renderViews({list: news});
                    });
                } else {
                    $(document).dialog({
                        type : "notice",
                        infoText: "已经到底部了",
                        autoClose: 1500,
                        position: "center"
                    });
                }
            }
        });

        function renderViews(data) {
				$(".news").renderValues(data, {
					handle: function (ele, value) {
						$(ele).attr("href", "/shore/personalContent.html?id="+value);
					}
				});
        }

       /* //查询功能
		$(".searchBtn").blur(function () {
            var keyword = $(".searchBtn").val();
            if (keyword){
              $.get("personal",{keyword:keyword},function (data) {
				   sessionStorage.setItem("data",JSON.stringify(data));
                   location.href="shore/personalContent.html.html";
                });
            }
           if (!keyword)  {
               location.href="shore/personalPage.html";
		   }
        })*/

		/*$(".fa-heart").click(function () {
		    alert(1)
			$("#conBtn").css("color","red")
        })*/
    })
</script>
</body>
</html>